package com.scedu.exception;

import com.scedu.enums.ResultEnums;

/*
异常类 不要继承Exception
 */
public class SellException extends RuntimeException {
    private  Integer code; //错误代码

    public SellException(ResultEnums resultEnums) {
        super(resultEnums.getMsg()); //把msg传到父类的构造方法中去  RuntimeException(String message)
        this.code = resultEnums.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public SellException(Integer code,String message) {
        super(message);
        this.code = code;

    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
